﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.actions {
    import Classes.*;
    import Classes.util.*;

    public class ActionCropHarvest extends ActionPickup {

        public function ActionCropHarvest(_arg1:NPC, _arg2:int, _arg3:MapResource){
            super(_arg1, _arg2, _arg3);
        }
        override protected function onAppear():void{
            super.onAppear();
        }
        override protected function onTravel():void{
            super.onTravel();
            if (!getTarget()){
                return;
            };
        }
        override protected function onPickup():void{
            var _local2:Ship;
            var _local3:Plot;
            super.onPickup();
            var _local1:HarvestableResource = (getTarget() as HarvestableResource);
            if (!_local1){
                return;
            };
            m_npc.getStateMachine().addActions(new ActionProgressBar(m_npc, _local1, _local1.getActionText(), _local1.getHarvestTime()));
            if ((_local1 is Ship)){
                _local2 = Ship(_local1);
                if (_local2.isLoaded()){
                    return;
                };
            };
            if ((_local1 is Plot)){
                _local3 = Plot(_local1);
                if (_local3.isHarvestable()){
                    return;
                };
            };
            Sounds.play("speedup");
        }
        override protected function onDisappear():void{
            super.onDisappear();
        }

    }
}//package Classes.actions 
